package com.example.mydemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

public class HelpTextActivity extends Activity {

    private LinearLayout linearLayout1;
    private ScrollView ScrollView1,ScrollView7,ScrollView8;
    private TextView tv;
    private TextView tvTitle;

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.help_text_layout);
        linearLayout1 = (LinearLayout) findViewById(R.id.ln_home);
        ScrollView1 = findViewById(R.id.ScrollView1);
        ScrollView7 = findViewById(R.id.ScrollView7);
        ScrollView8 = findViewById(R.id.ScrollView8);
        if (getIntent().getStringExtra("title").equals(getApplicationContext().getResources().getString(R.string.text7))){
            ScrollView1.setVisibility(View.GONE);
            tvTitle = findViewById(R.id.item7_title);
            ScrollView8.setVisibility(View.GONE);
        }else if (getIntent().getStringExtra("title").equals(getApplicationContext().getResources().getString(R.string.text8))){
            ScrollView1.setVisibility(View.GONE);
            tvTitle = findViewById(R.id.item8_title);
            ScrollView7.setVisibility(View.GONE);
        }else {
            tvTitle = findViewById(R.id.title3);
            tv = (TextView) findViewById(R.id.text3);
            tv.setText(getIntent().getStringExtra("data"));
            ScrollView7.setVisibility(View.GONE);
            ScrollView8.setVisibility(View.GONE);
        }

        Log.d("lfy","[HelpTextActivity] onCreate...type="+linearLayout1.getLayerType());
        tvTitle.setText(getIntent().getStringExtra("title"));
        linearLayout1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(HelpTextActivity.this, HelpActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                HelpTextActivity.this.startActivity(intent);
            }
        });
    }
}
